let mongoose = require('mongoose')
let moment=require('moment')
let dbsettings=require('./dbsettings')


let mongooseClient = mongoose.createConnection(dbsettings.DATABASE_URL, dbsettings.OPTIONS);

mongooseClient.on('connected', () => {
  console.log(moment(Date.now()).format('YYYY-MM-DD HH:mm:ss'));
  console.log('connected to ' + dbsettings.DATABASE_URL);
})

mongooseClient.on('connected', () => {
  console.log(moment(Date.now()).format('YYYY-MM-DD HH:mm:ss'));
  console.log('connected to ' + dbsettings.DATABASE_URL);
})


module.exports={
  mongooseClient: mongooseClient
}
